<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/swap.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/swap.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_noref.html#_X0xJTlVYX1NXQVBfSF8w"><span class="b">_LINUX_SWAP_H</span></a>
<a name="2" /><span class="True">       2:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_X0xJTlVYX1NXQVBfSF8w"><span class="b">_LINUX_SWAP_H</span></a>
<a name="3" /><span class="True">       3:</span> 
<a name="4" /><span class="True">       4:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">spinlock</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="5" /><span class="True">       5:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">linkage</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="6" /><span class="True">       6:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">mmzone</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="7" /><span class="True">       7:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">list</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="8" /><span class="True">       8:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">memcontrol</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="9" /><span class="True">       9:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">sched</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="10" /><span class="True">      10:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">node</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="11" /><span class="True">      11:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">fs</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="12" /><span class="True">      12:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">atomic</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="13" /><span class="True">      13:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">page</span><span class="f">-</span><span class="b">flags</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="14" /><span class="True">      14:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="m">asm</span><span class="f">/</span><span class="b">page</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="15" /><span class="True">      15:</span> 
<a name="16" /><span class="True">      16:</span> <span class="m">struct</span> <span class="b">notifier_block</span><span class="f">;</span>
<a name="17" /><span class="True">      17:</span> 
<a name="18" /><span class="True">      18:</span> <span class="m">struct</span> <span class="b">bio</span><span class="f">;</span>
<a name="19" /><span class="True">      19:</span> 
<a name="20" /><span class="True">      20:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX1BSRUZFUl8w"><span class="b">SWAP_FLAG_PREFER</span></a>    <span class="c">0x8000</span>    <span class="k">/* set if swap priority specified */</span>
<a name="21" /><span class="True">      21:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX1BSSU9fTUFTS18w"><span class="b">SWAP_FLAG_PRIO_MASK</span></a>    <span class="c">0x7fff</span>
<a name="22" /><span class="True">      22:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX1BSSU9fU0hJRlRfMA__"><span class="b">SWAP_FLAG_PRIO_SHIFT</span></a>    <span class="c">0</span>
<a name="23" /><span class="True">      23:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX0RJU0NBUkRfMA__"><span class="b">SWAP_FLAG_DISCARD</span></a>    <span class="c">0x10000</span> <span class="k">/* enable discard for swap */</span>
<a name="24" /><span class="True">      24:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX0RJU0NBUkRfT05DRV8w"><span class="b">SWAP_FLAG_DISCARD_ONCE</span></a>    <span class="c">0x20000</span> <span class="k">/* discard swap area at swapon-time */</span>
<a name="25" /><span class="True">      25:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX0RJU0NBUkRfUEFHRVNfMA__"><span class="b">SWAP_FLAG_DISCARD_PAGES</span></a> <span class="c">0x40000</span> <span class="k">/* discard page-clusters after use */</span>
<a name="26" /><span class="True">      26:</span> 
<a name="27" /><span class="True">      27:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHU19WQUxJRF8w"><span class="b">SWAP_FLAGS_VALID</span></a>    <span class="f">(</span><a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX1BSSU9fTUFTS18w"><span class="b">SWAP_FLAG_PRIO_MASK</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX1BSRUZFUl8w"><span class="b">SWAP_FLAG_PREFER</span></a> <span class="f">|</span> \
<a name="28" /><span class="True">      28:</span>                  <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX0RJU0NBUkRfMA__"><span class="b">SWAP_FLAG_DISCARD</span></a> <span class="f">|</span> <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX0RJU0NBUkRfT05DRV8w"><span class="b">SWAP_FLAG_DISCARD_ONCE</span></a> <span class="f">|</span> \
<a name="29" /><span class="True">      29:</span>                  <a href="cpu.c_macros_noref.html#_U1dBUF9GTEFHX0RJU0NBUkRfUEFHRVNfMA__"><span class="b">SWAP_FLAG_DISCARD_PAGES</span></a><span class="f">)</span>
<a name="30" /><span class="True">      30:</span> 
<a name="31" /><span class="True">      31:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">current_is_kswapd</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="32" /><span class="True">      32:</span> <span class="f">{</span>
<a name="33" /><span class="True">      33:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_Y3VycmVudF8w"><span class="b">current</span></a><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_UEZfS1NXQVBEXzA_"><span class="b">PF_KSWAPD</span></a><span class="f">;</span>
<a name="34" /><span class="True">      34:</span> <span class="f">}</span>
<a name="35" /><span class="True">      35:</span> 
<a name="36" /><span class="True">      36:</span> <span class="k">/*</span>
<a name="37" /><span class="True">      37:</span> <span class="k"> * MAX_SWAPFILES defines the maximum number of swaptypes: things which can</span>
<a name="38" /><span class="True">      38:</span> <span class="k"> * be swapped to.  The swap type and the offset into that swap type are</span>
<a name="39" /><span class="True">      39:</span> <span class="k"> * encoded into pte&apos;s and into pgoff_t&apos;s in the swapcache.  Using five bits</span>
<a name="40" /><span class="True">      40:</span> <span class="k"> * for the type means that the maximum number of swapcache pages is 27 bits</span>
<a name="41" /><span class="True">      41:</span> <span class="k"> * on 32-bit-pgoff_t architectures.  And that assumes that the architecture packs</span>
<a name="42" /><span class="True">      42:</span> <span class="k"> * the type/offset into the pte as 5/27 as well.</span>
<a name="43" /><span class="True">      43:</span> <span class="k"> */</span>
<a name="44" /><span class="True">      44:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TUFYX1NXQVBGSUxFU19TSElGVF8w"><span class="b">MAX_SWAPFILES_SHIFT</span></a>    <span class="c">5</span>
<a name="45" /><span class="True">      45:</span> 
<a name="46" /><span class="True">      46:</span> <span class="k">/*</span>
<a name="47" /><span class="True">      47:</span> <span class="k"> * Use some of the swap files numbers for other purposes. This</span>
<a name="48" /><span class="True">      48:</span> <span class="k"> * is a convenient way to hook into the VM to trigger special</span>
<a name="49" /><span class="True">      49:</span> <span class="k"> * actions on faults.</span>
<a name="50" /><span class="True">      50:</span> <span class="k"> */</span>
<a name="51" /><span class="True">      51:</span> 
<a name="52" /><span class="True">      52:</span> <span class="k">/*</span>
<a name="53" /><span class="True">      53:</span> <span class="k"> * NUMA node memory migration support</span>
<a name="54" /><span class="True">      54:</span> <span class="k"> */</span>
<a name="55" /><span class="True">      55:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01JR1JBVElPTl8w"><span class="b">CONFIG_MIGRATION</span></a>
<a name="56" /><span class="True">      56:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dQX01JR1JBVElPTl9OVU1fMA__"><span class="b">SWP_MIGRATION_NUM</span></a> <span class="c">2</span>
<a name="57" /><span class="True">      57:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dQX01JR1JBVElPTl9SRUFEXzA_"><span class="b">SWP_MIGRATION_READ</span></a>    <span class="f">(</span><a href="cpu.c_macros_noref.html#_TUFYX1NXQVBGSUxFU18w"><span class="b">MAX_SWAPFILES</span></a> <span class="f">+</span> <a href="cpu.c_macros_noref.html#_U1dQX0hXUE9JU09OX05VTV8w"><span class="b">SWP_HWPOISON_NUM</span></a><span class="f">)</span>
<a name="58" /><span class="True">      58:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dQX01JR1JBVElPTl9XUklURV8w"><span class="b">SWP_MIGRATION_WRITE</span></a>    <span class="f">(</span><a href="cpu.c_macros_noref.html#_TUFYX1NXQVBGSUxFU18w"><span class="b">MAX_SWAPFILES</span></a> <span class="f">+</span> <a href="cpu.c_macros_noref.html#_U1dQX0hXUE9JU09OX05VTV8w"><span class="b">SWP_HWPOISON_NUM</span></a> <span class="f">+</span> <span class="c">1</span><span class="f">)</span>
<a name="59" /><span class="False">      59:</span> <span class="f">#</span><span class="n">else</span>
<a name="60" /><span class="False">      60:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dQX01JR1JBVElPTl9OVU1fMA__"><span class="b">SWP_MIGRATION_NUM</span></a> <span class="c">0</span>
<a name="61" /><span class="True">      61:</span> <span class="f">#</span><span class="n">endif</span>
<a name="62" /><span class="True">      62:</span> 
<a name="63" /><span class="True">      63:</span> <span class="k">/*</span>
<a name="64" /><span class="True">      64:</span> <span class="k"> * Handling of hardware poisoned pages with memory corruption.</span>
<a name="65" /><span class="True">      65:</span> <span class="k"> */</span>
<a name="66" /><span class="True">      66:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX01FTU9SWV9GQUlMVVJFXzA_"><span class="b">CONFIG_MEMORY_FAILURE</span></a>
<a name="67" /><span class="True">      67:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dQX0hXUE9JU09OX05VTV8w"><span class="b">SWP_HWPOISON_NUM</span></a> <span class="c">1</span>
<a name="68" /><span class="True">      68:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dQX0hXUE9JU09OXzA_"><span class="b">SWP_HWPOISON</span></a>        <a href="cpu.c_macros_noref.html#_TUFYX1NXQVBGSUxFU18w"><span class="b">MAX_SWAPFILES</span></a>
<a name="69" /><span class="False">      69:</span> <span class="f">#</span><span class="n">else</span>
<a name="70" /><span class="False">      70:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dQX0hXUE9JU09OX05VTV8w"><span class="b">SWP_HWPOISON_NUM</span></a> <span class="c">0</span>
<a name="71" /><span class="True">      71:</span> <span class="f">#</span><span class="n">endif</span>
<a name="72" /><span class="True">      72:</span> 
<a name="73" /><span class="True">      73:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TUFYX1NXQVBGSUxFU18w"><span class="b">MAX_SWAPFILES</span></a> \
<a name="74" /><span class="True">      74:</span>     <span class="f">(</span><span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <a href="cpu.c_macros_noref.html#_TUFYX1NXQVBGSUxFU19TSElGVF8w"><span class="b">MAX_SWAPFILES_SHIFT</span></a><span class="f">)</span> <span class="f">-</span> <a href="cpu.c_macros_noref.html#_U1dQX01JR1JBVElPTl9OVU1fMA__"><span class="b">SWP_MIGRATION_NUM</span></a> <span class="f">-</span> <a href="cpu.c_macros_noref.html#_U1dQX0hXUE9JU09OX05VTV8w"><span class="b">SWP_HWPOISON_NUM</span></a><span class="f">)</span>
<a name="75" /><span class="True">      75:</span> 
<a name="76" /><span class="True">      76:</span> <span class="k">/*</span>
<a name="77" /><span class="True">      77:</span> <span class="k"> * Magic header for a swap area. The first part of the union is</span>
<a name="78" /><span class="True">      78:</span> <span class="k"> * what the swap magic looks like for the old (limited to 128MB)</span>
<a name="79" /><span class="True">      79:</span> <span class="k"> * swap area format, the second part of the union adds - in the</span>
<a name="80" /><span class="True">      80:</span> <span class="k"> * old reserved area - some extra information. Note that the first</span>
<a name="81" /><span class="True">      81:</span> <span class="k"> * kilobyte is reserved for boot loader or disk label stuff...</span>
<a name="82" /><span class="True">      82:</span> <span class="k"> *</span>
<a name="83" /><span class="True">      83:</span> <span class="k"> * Having the magic at the end of the PAGE_SIZE makes detecting swap</span>
<a name="84" /><span class="True">      84:</span> <span class="k"> * areas somewhat tricky on machines that support multiple page sizes.</span>
<a name="85" /><span class="True">      85:</span> <span class="k"> * For 2.5 we&apos;ll probably want to move the magic to just beyond the</span>
<a name="86" /><span class="True">      86:</span> <span class="k"> * bootbits...</span>
<a name="87" /><span class="True">      87:</span> <span class="k"> */</span>
<a name="88" /><span class="True">      88:</span> <span class="m">union</span> <span class="b">swap_header</span> <span class="f">{</span>
<a name="89" /><span class="True">      89:</span>     <span class="m">struct</span> <span class="f">{</span>
<a name="90" /><span class="True">      90:</span>         <span class="m">char</span> <span class="b">reserved</span><span class="f">[</span><a href="cpu.c_macros_ref.html#_UEFHRV9TSVpFXzA_"><span class="b">PAGE_SIZE</span></a> <span class="f">-</span> <span class="c">10</span><span class="f">]</span><span class="f">;</span>
<a name="91" /><span class="True">      91:</span>         <span class="m">char</span> <span class="b">magic</span><span class="f">[</span><span class="c">10</span><span class="f">]</span><span class="f">;</span>            <span class="k">/* SWAP-SPACE or SWAPSPACE2 */</span>
<a name="92" /><span class="True">      92:</span>     <span class="f">}</span> <span class="b">magic</span><span class="f">;</span>
<a name="93" /><span class="True">      93:</span>     <span class="m">struct</span> <span class="f">{</span>
<a name="94" /><span class="True">      94:</span>         <span class="m">char</span>        <span class="b">bootbits</span><span class="f">[</span><span class="c">1024</span><span class="f">]</span><span class="f">;</span>    <span class="k">/* Space for disklabel etc. */</span>
<a name="95" /><span class="True">      95:</span>         <span class="b">__u32</span>        <span class="b">version</span><span class="f">;</span>
<a name="96" /><span class="True">      96:</span>         <span class="b">__u32</span>        <span class="b">last_page</span><span class="f">;</span>
<a name="97" /><span class="True">      97:</span>         <span class="b">__u32</span>        <span class="b">nr_badpages</span><span class="f">;</span>
<a name="98" /><span class="True">      98:</span>         <span class="m">unsigned</span> <span class="m">char</span>    <span class="b">sws_uuid</span><span class="f">[</span><span class="c">16</span><span class="f">]</span><span class="f">;</span>
<a name="99" /><span class="True">      99:</span>         <span class="m">unsigned</span> <span class="m">char</span>    <span class="b">sws_volume</span><span class="f">[</span><span class="c">16</span><span class="f">]</span><span class="f">;</span>
<a name="100" /><span class="True">     100:</span>         <span class="b">__u32</span>        <span class="b">padding</span><span class="f">[</span><span class="c">117</span><span class="f">]</span><span class="f">;</span>
<a name="101" /><span class="True">     101:</span>         <span class="b">__u32</span>        <span class="b">badpages</span><span class="f">[</span><span class="c">1</span><span class="f">]</span><span class="f">;</span>
<a name="102" /><span class="True">     102:</span>     <span class="f">}</span> <span class="b">info</span><span class="f">;</span>
<a name="103" /><span class="True">     103:</span> <span class="f">}</span><span class="f">;</span>
<a name="104" /><span class="True">     104:</span> 
<a name="105" /><span class="True">     105:</span>  <span class="k">/* A swap entry has to fit into a &quot;unsigned long&quot;, as</span>
<a name="106" /><span class="True">     106:</span> <span class="k">  * the entry is hidden in the &quot;index&quot; field of the</span>
<a name="107" /><span class="True">     107:</span> <span class="k">  * swapper address space.</span>
<a name="108" /><span class="True">     108:</span> <span class="k">  */</span>
<a name="109" /><span class="True">     109:</span> <span class="m">typedef</span> <span class="m">struct</span> <span class="f">{</span>
<a name="110" /><span class="True">     110:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">val</span><span class="f">;</span>
<a name="111" /><span class="True">     111:</span> <span class="f">}</span> <span class="b">swp_entry_t</span><span class="f">;</span>
<a name="112" /><span class="True">     112:</span> 
<a name="113" /><span class="True">     113:</span> <span class="k">/*</span>
<a name="114" /><span class="True">     114:</span> <span class="k"> * current-&gt;reclaim_state points to one of these when a task is running</span>
<a name="115" /><span class="True">     115:</span> <span class="k"> * memory reclaim</span>
<a name="116" /><span class="True">     116:</span> <span class="k"> */</span>
<a name="117" /><span class="True">     117:</span> <span class="m">struct</span> <span class="b">reclaim_state</span> <span class="f">{</span>
<a name="118" /><span class="True">     118:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">reclaimed_slab</span><span class="f">;</span>
<a name="119" /><span class="True">     119:</span> <span class="f">}</span><span class="f">;</span>
<a name="120" /><span class="True">     120:</span> 
<a name="121" /><span class="True">     121:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_X19LRVJORUxfX18w"><span class="b">__KERNEL__</span></a>
<a name="122" /><span class="True">     122:</span> 
<a name="123" /><span class="True">     123:</span> <span class="m">struct</span> <span class="b">address_space</span><span class="f">;</span>
<a name="124" /><span class="True">     124:</span> <span class="m">struct</span> <span class="b">sysinfo</span><span class="f">;</span>
<a name="125" /><span class="True">     125:</span> <span class="m">struct</span> <span class="b">writeback_control</span><span class="f">;</span>
<a name="126" /><span class="True">     126:</span> <span class="m">struct</span> <span class="b">zone</span><span class="f">;</span>
<a name="127" /><span class="True">     127:</span> 
<a name="128" /><span class="True">     128:</span> <span class="k">/*</span>
<a name="129" /><span class="True">     129:</span> <span class="k"> * A swap extent maps a range of a swapfile&apos;s PAGE_SIZE pages onto a range of</span>
<a name="130" /><span class="True">     130:</span> <span class="k"> * disk blocks.  A list of swap extents maps the entire swapfile.  (Where the</span>
<a name="131" /><span class="True">     131:</span> <span class="k"> * term `swapfile&apos; refers to either a blockdevice or an IS_REG file.  Apart</span>
<a name="132" /><span class="True">     132:</span> <span class="k"> * from setup, they&apos;re handled identically.</span>
<a name="133" /><span class="True">     133:</span> <span class="k"> *</span>
<a name="134" /><span class="True">     134:</span> <span class="k"> * We always assume that blocks are of size PAGE_SIZE.</span>
<a name="135" /><span class="True">     135:</span> <span class="k"> */</span>
<a name="136" /><span class="True">     136:</span> <span class="m">struct</span> <span class="b">swap_extent</span> <span class="f">{</span>
<a name="137" /><span class="True">     137:</span>     <span class="m">struct</span> <span class="b">list_head</span> <span class="b">list</span><span class="f">;</span>
<a name="138" /><span class="True">     138:</span>     <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">start_page</span><span class="f">;</span>
<a name="139" /><span class="True">     139:</span>     <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a> <span class="b">nr_pages</span><span class="f">;</span>
<a name="140" /><span class="True">     140:</span>     <span class="b">sector_t</span> <span class="b">start_block</span><span class="f">;</span>
<a name="141" /><span class="True">     141:</span> <span class="f">}</span><span class="f">;</span>
<a name="142" /><span class="True">     142:</span> 
<a name="143" /><span class="True">     143:</span> <span class="k">/*</span>
<a name="144" /><span class="True">     144:</span> <span class="k"> * Max bad pages in the new format..</span>
<a name="145" /><span class="True">     145:</span> <span class="k"> */</span>
<a name="146" /><span class="True">     146:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_X19zd2Fwb2Zmc2V0XzA_"><span class="b">__swapoffset</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span><span class="f">&amp;</span><span class="f">(</span><span class="f">(</span><span class="m">union</span> <span class="b">swap_header</span> <span class="f">*</span><span class="f">)</span><span class="c">0</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">x</span><span class="f">)</span>
<a name="147" /><span class="True">     147:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TUFYX1NXQVBfQkFEUEFHRVNfMA__"><span class="b">MAX_SWAP_BADPAGES</span></a> \
<a name="148" /><span class="True">     148:</span>     <span class="f">(</span><span class="f">(</span><a href="cpu.c_macros_noref.html#_X19zd2Fwb2Zmc2V0XzA_"><span class="b">__swapoffset</span></a><span class="f">(</span><span class="b">magic</span><span class="f">.</span><span class="b">magic</span><span class="f">)</span> <span class="f">-</span> <a href="cpu.c_macros_noref.html#_X19zd2Fwb2Zmc2V0XzA_"><span class="b">__swapoffset</span></a><span class="f">(</span><span class="b">info</span><span class="f">.</span><span class="b">badpages</span><span class="f">)</span><span class="f">)</span> <span class="f">/</span> <span class="m">sizeof</span><span class="f">(</span><span class="m">int</span><span class="f">)</span><span class="f">)</span>
<a name="149" /><span class="True">     149:</span> 
<a name="150" /><span class="True">     150:</span> <span class="m">enum</span> <span class="f">{</span>
<a name="151" /><span class="True">     151:</span>     <span class="b">SWP_USED</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">0</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* is slot in swap_info[] used? */</span>
<a name="152" /><span class="True">     152:</span>     <span class="b">SWP_WRITEOK</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">1</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* ok to write to this swap?    */</span>
<a name="153" /><span class="True">     153:</span>     <span class="b">SWP_DISCARDABLE</span> <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">2</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* blkdev support discard */</span>
<a name="154" /><span class="True">     154:</span>     <span class="b">SWP_DISCARDING</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">3</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* now discarding a free cluster */</span>
<a name="155" /><span class="True">     155:</span>     <span class="b">SWP_SOLIDSTATE</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">4</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* blkdev seeks are cheap */</span>
<a name="156" /><span class="True">     156:</span>     <span class="b">SWP_CONTINUED</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">5</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* swap_map has count continuation */</span>
<a name="157" /><span class="True">     157:</span>     <span class="b">SWP_BLKDEV</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">6</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* its a block device */</span>
<a name="158" /><span class="True">     158:</span>     <span class="b">SWP_FILE</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">7</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* set after swap_activate success */</span>
<a name="159" /><span class="True">     159:</span>     <span class="b">SWP_AREA_DISCARD</span> <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">8</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* single-time swap area discards */</span>
<a name="160" /><span class="True">     160:</span>     <span class="b">SWP_PAGE_DISCARD</span> <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">9</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* freed swap page-cluster discards */</span>
<a name="161" /><span class="True">     161:</span>                     <span class="k">/* add others here before... */</span>
<a name="162" /><span class="True">     162:</span>     <span class="b">SWP_SCANNING</span>    <span class="f">=</span> <span class="f">(</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">10</span><span class="f">)</span><span class="f">,</span>    <span class="k">/* refcount in scan_swap_map */</span>
<a name="163" /><span class="True">     163:</span> <span class="f">}</span><span class="f">;</span>
<a name="164" /><span class="True">     164:</span> 
<a name="165" /><span class="True">     165:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9DTFVTVEVSX01BWF8w"><span class="b">SWAP_CLUSTER_MAX</span></a> <span class="c">32UL</span>
<a name="166" /><span class="True">     166:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q09NUEFDVF9DTFVTVEVSX01BWF8w"><span class="b">COMPACT_CLUSTER_MAX</span></a> <a href="cpu.c_macros_noref.html#_U1dBUF9DTFVTVEVSX01BWF8w"><span class="b">SWAP_CLUSTER_MAX</span></a>
<a name="167" /><span class="True">     167:</span> 
<a name="168" /><span class="True">     168:</span> <span class="k">/*</span>
<a name="169" /><span class="True">     169:</span> <span class="k"> * Ratio between the present memory in the zone and the &quot;gap&quot; that</span>
<a name="170" /><span class="True">     170:</span> <span class="k"> * we&apos;re allowing kswapd to shrink in addition to the per-zone high</span>
<a name="171" /><span class="True">     171:</span> <span class="k"> * wmark, even for zones that already have the high wmark satisfied,</span>
<a name="172" /><span class="True">     172:</span> <span class="k"> * in order to provide better per-zone lru behavior. We are ok to</span>
<a name="173" /><span class="True">     173:</span> <span class="k"> * spend not more than 1% of the memory for this zone balancing &quot;gap&quot;.</span>
<a name="174" /><span class="True">     174:</span> <span class="k"> */</span>
<a name="175" /><span class="True">     175:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_S1NXQVBEX1pPTkVfQkFMQU5DRV9HQVBfUkFUSU9fMA__"><span class="b">KSWAPD_ZONE_BALANCE_GAP_RATIO</span></a> <span class="c">100</span>
<a name="176" /><span class="True">     176:</span> 
<a name="177" /><span class="True">     177:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9NQVBfTUFYXzA_"><span class="b">SWAP_MAP_MAX</span></a>    <span class="c">0x3e</span>    <span class="k">/* Max duplication count, in first swap_map */</span>
<a name="178" /><span class="True">     178:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9NQVBfQkFEXzA_"><span class="b">SWAP_MAP_BAD</span></a>    <span class="c">0x3f</span>    <span class="k">/* Note pageblock is bad, in first swap_map */</span>
<a name="179" /><span class="True">     179:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9IQVNfQ0FDSEVfMA__"><span class="b">SWAP_HAS_CACHE</span></a>    <span class="c">0x40</span>    <span class="k">/* Flag page is cached, in first swap_map */</span>
<a name="180" /><span class="True">     180:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9DT05UX01BWF8w"><span class="b">SWAP_CONT_MAX</span></a>    <span class="c">0x7f</span>    <span class="k">/* Max count, in each swap_map continuation */</span>
<a name="181" /><span class="True">     181:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q09VTlRfQ09OVElOVUVEXzA_"><span class="b">COUNT_CONTINUED</span></a>    <span class="c">0x80</span>    <span class="k">/* See swap_map continuation for full count */</span>
<a name="182" /><span class="True">     182:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_U1dBUF9NQVBfU0hNRU1fMA__"><span class="b">SWAP_MAP_SHMEM</span></a>    <span class="c">0xbf</span>    <span class="k">/* Owned by shmem/tmpfs, in first swap_map */</span>
<a name="183" /><span class="True">     183:</span> 
<a name="184" /><span class="True">     184:</span> <span class="k">/*</span>
<a name="185" /><span class="True">     185:</span> <span class="k"> * We use this to track usage of a cluster. A cluster is a block of swap disk</span>
<a name="186" /><span class="True">     186:</span> <span class="k"> * space with SWAPFILE_CLUSTER pages long and naturally aligns in disk. All</span>
<a name="187" /><span class="True">     187:</span> <span class="k"> * free clusters are organized into a list. We fetch an entry from the list to</span>
<a name="188" /><span class="True">     188:</span> <span class="k"> * get a free cluster.</span>
<a name="189" /><span class="True">     189:</span> <span class="k"> *</span>
<a name="190" /><span class="True">     190:</span> <span class="k"> * The data field stores next cluster if the cluster is free or cluster usage</span>
<a name="191" /><span class="True">     191:</span> <span class="k"> * counter otherwise. The flags field determines if a cluster is free. This is</span>
<a name="192" /><span class="True">     192:</span> <span class="k"> * protected by swap_info_struct.lock.</span>
<a name="193" /><span class="True">     193:</span> <span class="k"> */</span>
<a name="194" /><span class="True">     194:</span> <span class="m">struct</span> <span class="b">swap_cluster_info</span> <span class="f">{</span>
<a name="195" /><span class="True">     195:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">data</span><span class="f">:</span><span class="c">24</span><span class="f">;</span>
<a name="196" /><span class="True">     196:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">flags</span><span class="f">:</span><span class="c">8</span><span class="f">;</span>
<a name="197" /><span class="True">     197:</span> <span class="f">}</span><span class="f">;</span>
<a name="198" /><span class="True">     198:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q0xVU1RFUl9GTEFHX0ZSRUVfMA__"><span class="b">CLUSTER_FLAG_FREE</span></a> <span class="c">1</span> <span class="k">/* This cluster is free */</span>
<a name="199" /><span class="True">     199:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Q0xVU1RFUl9GTEFHX05FWFRfTlVMTF8w"><span class="b">CLUSTER_FLAG_NEXT_NULL</span></a> <span class="c">2</span> <span class="k">/* This cluster has no next cluster */</span>
<a name="200" /><span class="True">     200:</span> 
<a name="201" /><span class="True">     201:</span> <span class="k">/*</span>
<a name="202" /><span class="True">     202:</span> <span class="k"> * We assign a cluster to each CPU, so each CPU can allocate swap entry from</span>
<a name="203" /><span class="True">     203:</span> <span class="k"> * its own cluster and swapout sequentially. The purpose is to optimize swapout</span>
<a name="204" /><span class="True">     204:</span> <span class="k"> * throughput.</span>
<a name="205" /><span class="True">     205:</span> <span class="k"> */</span>
<a name="206" /><span class="True">     206:</span> <span class="m">struct</span> <span class="b">percpu_cluster</span> <span class="f">{</span>
<a name="207" /><span class="True">     207:</span>     <span class="m">struct</span> <span class="b">swap_cluster_info</span> <span class="b">index</span><span class="f">;</span> <span class="k">/* Current cluster index */</span>
<a name="208" /><span class="True">     208:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">next</span><span class="f">;</span> <span class="k">/* Likely next allocation offset */</span>
<a name="209" /><span class="True">     209:</span> <span class="f">}</span><span class="f">;</span>
<a name="210" /><span class="True">     210:</span> 
<a name="211" /><span class="True">     211:</span> <span class="k">/*</span>
<a name="212" /><span class="True">     212:</span> <span class="k"> * The in-memory structure used to track swap areas.</span>
<a name="213" /><span class="True">     213:</span> <span class="k"> */</span>
<a name="214" /><span class="True">     214:</span> <span class="m">struct</span> <span class="b">swap_info_struct</span> <span class="f">{</span>
<a name="215" /><span class="True">     215:</span>     <span class="m">unsigned</span> <span class="m">long</span>    <span class="b">flags</span><span class="f">;</span>        <span class="k">/* SWP_USED etc: see above */</span>
<a name="216" /><span class="True">     216:</span>     <span class="m">signed</span> <span class="m">short</span>    <span class="b">prio</span><span class="f">;</span>        <span class="k">/* swap priority of this type */</span>
<a name="217" /><span class="True">     217:</span>     <span class="m">signed</span> <span class="m">char</span>    <span class="b">type</span><span class="f">;</span>        <span class="k">/* strange name for an index */</span>
<a name="218" /><span class="True">     218:</span>     <span class="m">signed</span> <span class="m">char</span>    <span class="b">next</span><span class="f">;</span>        <span class="k">/* next type on the swap list */</span>
<a name="219" /><span class="True">     219:</span>     <span class="m">unsigned</span> <span class="m">int</span>    <a href="cpu.c_macros_ref.html#_bWF4XzA_"><span class="b">max</span></a><span class="f">;</span>        <span class="k">/* extent of the swap_map */</span>
<a name="220" /><span class="True">     220:</span>     <span class="m">unsigned</span> <span class="m">char</span> <span class="f">*</span><span class="b">swap_map</span><span class="f">;</span>    <span class="k">/* vmalloc&apos;ed array of usage counts */</span>
<a name="221" /><span class="True">     221:</span>     <span class="m">struct</span> <span class="b">swap_cluster_info</span> <span class="f">*</span><span class="b">cluster_info</span><span class="f">;</span> <span class="k">/* cluster info. Only for SSD */</span>
<a name="222" /><span class="True">     222:</span>     <span class="m">struct</span> <span class="b">swap_cluster_info</span> <span class="b">free_cluster_head</span><span class="f">;</span> <span class="k">/* free cluster list head */</span>
<a name="223" /><span class="True">     223:</span>     <span class="m">struct</span> <span class="b">swap_cluster_info</span> <span class="b">free_cluster_tail</span><span class="f">;</span> <span class="k">/* free cluster list tail */</span>
<a name="224" /><span class="True">     224:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">lowest_bit</span><span class="f">;</span>    <span class="k">/* index of first free in swap_map */</span>
<a name="225" /><span class="True">     225:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">highest_bit</span><span class="f">;</span>    <span class="k">/* index of last free in swap_map */</span>
<a name="226" /><span class="True">     226:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">pages</span><span class="f">;</span>        <span class="k">/* total of usable pages of swap */</span>
<a name="227" /><span class="True">     227:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">inuse_pages</span><span class="f">;</span>    <span class="k">/* number of those currently in use */</span>
<a name="228" /><span class="True">     228:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">cluster_next</span><span class="f">;</span>    <span class="k">/* likely index for next allocation */</span>
<a name="229" /><span class="True">     229:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">cluster_nr</span><span class="f">;</span>    <span class="k">/* countdown to next cluster search */</span>
<a name="230" /><span class="True">     230:</span>     <span class="m">struct</span> <span class="b">percpu_cluster</span> <a href="cpu.c_macros_ref.html#_X19wZXJjcHVfMA__"><span class="b">__percpu</span></a> <span class="f">*</span><span class="b">percpu_cluster</span><span class="f">;</span> <span class="k">/* per cpu&apos;s swap location */</span>
<a name="231" /><span class="True">     231:</span>     <span class="m">struct</span> <span class="b">swap_extent</span> <span class="f">*</span><span class="b">curr_swap_extent</span><span class="f">;</span>
<a name="232" /><span class="True">     232:</span>     <span class="m">struct</span> <span class="b">swap_extent</span> <span class="b">first_swap_extent</span><span class="f">;</span>
<a name="233" /><span class="True">     233:</span>     <span class="m">struct</span> <span class="b">block_device</span> <span class="f">*</span><span class="b">bdev</span><span class="f">;</span>    <span class="k">/* swap device or bdev of swap file */</span>
<a name="234" /><span class="True">     234:</span>     <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="b">swap_file</span><span class="f">;</span>        <span class="k">/* seldom referenced */</span>
<a name="235" /><span class="True">     235:</span>     <span class="m">unsigned</span> <span class="m">int</span> <span class="b">old_block_size</span><span class="f">;</span>    <span class="k">/* seldom referenced */</span>
<a name="236" /><span class="False">     236:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_FRONTSWAP</span>
<a name="237" /><span class="False">     237:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">frontswap_map</span><span class="f">;</span>    <span class="k">/* frontswap in-use, one bit per page */</span>
<a name="238" /><span class="False">     238:</span>     <span class="b">atomic_t</span> <span class="b">frontswap_pages</span><span class="f">;</span>    <span class="k">/* frontswap pages in-use counter */</span>
<a name="239" /><span class="True">     239:</span> <span class="f">#</span><span class="n">endif</span>
<a name="240" /><span class="True">     240:</span>     <span class="b">spinlock_t</span> <span class="b">lock</span><span class="f">;</span>        <span class="k">/*</span>
<a name="241" /><span class="True">     241:</span> <span class="k">                     * protect map scan related fields like</span>
<a name="242" /><span class="True">     242:</span> <span class="k">                     * swap_map, lowest_bit, highest_bit,</span>
<a name="243" /><span class="True">     243:</span> <span class="k">                     * inuse_pages, cluster_next,</span>
<a name="244" /><span class="True">     244:</span> <span class="k">                     * cluster_nr, lowest_alloc,</span>
<a name="245" /><span class="True">     245:</span> <span class="k">                     * highest_alloc, free/discard cluster</span>
<a name="246" /><span class="True">     246:</span> <span class="k">                     * list. other fields are only changed</span>
<a name="247" /><span class="True">     247:</span> <span class="k">                     * at swapon/swapoff, so are protected</span>
<a name="248" /><span class="True">     248:</span> <span class="k">                     * by swap_lock. changing flags need</span>
<a name="249" /><span class="True">     249:</span> <span class="k">                     * hold this lock and swap_lock. If</span>
<a name="250" /><span class="True">     250:</span> <span class="k">                     * both locks need hold, hold swap_lock</span>
<a name="251" /><span class="True">     251:</span> <span class="k">                     * first.</span>
<a name="252" /><span class="True">     252:</span> <span class="k">                     */</span>
<a name="253" /><span class="True">     253:</span>     <span class="m">struct</span> <span class="b">work_struct</span> <span class="b">discard_work</span><span class="f">;</span> <span class="k">/* discard worker */</span>
<a name="254" /><span class="True">     254:</span>     <span class="m">struct</span> <span class="b">swap_cluster_info</span> <span class="b">discard_cluster_head</span><span class="f">;</span> <span class="k">/* list head of discard clusters */</span>
<a name="255" /><span class="True">     255:</span>     <span class="m">struct</span> <span class="b">swap_cluster_info</span> <span class="b">discard_cluster_tail</span><span class="f">;</span> <span class="k">/* list tail of discard clusters */</span>
<a name="256" /><span class="True">     256:</span> <span class="f">}</span><span class="f">;</span>
<a name="257" /><span class="True">     257:</span> 
<a name="258" /><span class="True">     258:</span> <span class="m">struct</span> <span class="b">swap_list_t</span> <span class="f">{</span>
<a name="259" /><span class="True">     259:</span>     <span class="m">int</span> <span class="b">head</span><span class="f">;</span>    <span class="k">/* head of priority-ordered swapfile list */</span>
<a name="260" /><span class="True">     260:</span>     <span class="m">int</span> <span class="b">next</span><span class="f">;</span>    <span class="k">/* swapfile to be used next */</span>
<a name="261" /><span class="True">     261:</span> <span class="f">}</span><span class="f">;</span>
<a name="262" /><span class="True">     262:</span> 
<a name="263" /><span class="True">     263:</span> <span class="k">/* linux/mm/page_alloc.c */</span>
<a name="264" /><span class="True">     264:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">totalram_pages</span><span class="f">;</span>
<a name="265" /><span class="True">     265:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">totalreserve_pages</span><span class="f">;</span>
<a name="266" /><span class="True">     266:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">dirty_balance_reserve</span><span class="f">;</span>
<a name="267" /><span class="True">     267:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_free_buffer_pages</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="268" /><span class="True">     268:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_free_pagecache_pages</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="269" /><span class="True">     269:</span> 
<a name="270" /><span class="True">     270:</span> <span class="k">/* Definition of global_page_state not available yet */</span>
<a name="271" /><span class="True">     271:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_bnJfZnJlZV9wYWdlc18w"><span class="b">nr_free_pages</span></a><span class="f">(</span><span class="f">)</span> <span class="b">global_page_state</span><span class="f">(</span><span class="b">NR_FREE_PAGES</span><span class="f">)</span>
<a name="272" /><span class="True">     272:</span> 
<a name="273" /><span class="True">     273:</span> 
<a name="274" /><span class="True">     274:</span> <span class="k">/* linux/mm/swap.c */</span>
<a name="275" /><span class="True">     275:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">__lru_cache_add</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="276" /><span class="True">     276:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">lru_cache_add</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="277" /><span class="True">     277:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">lru_add_page_tail</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page_tail</span><span class="f">,</span>
<a name="278" /><span class="True">     278:</span>              <span class="m">struct</span> <span class="b">lruvec</span> <span class="f">*</span><span class="b">lruvec</span><span class="f">,</span> <span class="m">struct</span> <span class="b">list_head</span> <span class="f">*</span><span class="b">head</span><span class="f">)</span><span class="f">;</span>
<a name="279" /><span class="True">     279:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">activate_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="280" /><span class="True">     280:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mark_page_accessed</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="281" /><span class="True">     281:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">lru_add_drain</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="282" /><span class="True">     282:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">lru_add_drain_cpu</span><span class="f">(</span><span class="m">int</span> <span class="b">cpu</span><span class="f">)</span><span class="f">;</span>
<a name="283" /><span class="True">     283:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">lru_add_drain_all</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="284" /><span class="True">     284:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">rotate_reclaimable_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="285" /><span class="True">     285:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">deactivate_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="286" /><span class="True">     286:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">swap_setup</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="287" /><span class="True">     287:</span> 
<a name="288" /><span class="True">     288:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">add_page_to_unevictable_list</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="289" /><span class="True">     289:</span> 
<a name="290" /><span class="True">     290:</span> <span class="k">/**</span>
<a name="291" /><span class="True">     291:</span> <span class="k"> * lru_cache_add: add a page to the page lists</span>
<a name="292" /><span class="True">     292:</span> <span class="k"> * @page: the page to add</span>
<a name="293" /><span class="True">     293:</span> <span class="k"> */</span>
<a name="294" /><span class="True">     294:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">lru_cache_add_anon</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="295" /><span class="True">     295:</span> <span class="f">{</span>
<a name="296" /><span class="True">     296:</span>     <span class="b">ClearPageActive</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="297" /><span class="True">     297:</span>     <span class="b">__lru_cache_add</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="298" /><span class="True">     298:</span> <span class="f">}</span>
<a name="299" /><span class="True">     299:</span> 
<a name="300" /><span class="True">     300:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">lru_cache_add_file</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="301" /><span class="True">     301:</span> <span class="f">{</span>
<a name="302" /><span class="True">     302:</span>     <span class="b">ClearPageActive</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="303" /><span class="True">     303:</span>     <span class="b">__lru_cache_add</span><span class="f">(</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="304" /><span class="True">     304:</span> <span class="f">}</span>
<a name="305" /><span class="True">     305:</span> 
<a name="306" /><span class="True">     306:</span> <span class="k">/* linux/mm/vmscan.c */</span>
<a name="307" /><span class="True">     307:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">try_to_free_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">zonelist</span> <span class="f">*</span><span class="b">zonelist</span><span class="f">,</span> <span class="m">int</span> <span class="b">order</span><span class="f">,</span>
<a name="308" /><span class="True">     308:</span>                     <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span> <span class="b">nodemask_t</span> <span class="f">*</span><span class="b">mask</span><span class="f">)</span><span class="f">;</span>
<a name="309" /><span class="True">     309:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">__isolate_lru_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">isolate_mode_t</span> <span class="b">mode</span><span class="f">)</span><span class="f">;</span>
<a name="310" /><span class="True">     310:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">try_to_free_mem_cgroup_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">mem</span><span class="f">,</span>
<a name="311" /><span class="True">     311:</span>                           <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span> <span class="m">bool</span> <span class="b">noswap</span><span class="f">)</span><span class="f">;</span>
<a name="312" /><span class="True">     312:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">mem_cgroup_shrink_node_zone</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">mem</span><span class="f">,</span>
<a name="313" /><span class="True">     313:</span>                         <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span> <span class="m">bool</span> <span class="b">noswap</span><span class="f">,</span>
<a name="314" /><span class="True">     314:</span>                         <span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">zone</span><span class="f">,</span>
<a name="315" /><span class="True">     315:</span>                         <span class="m">unsigned</span> <span class="m">long</span> <span class="f">*</span><span class="b">nr_scanned</span><span class="f">)</span><span class="f">;</span>
<a name="316" /><span class="True">     316:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">shrink_all_memory</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_pages</span><span class="f">)</span><span class="f">;</span>
<a name="317" /><span class="True">     317:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">vm_swappiness</span><span class="f">;</span>
<a name="318" /><span class="True">     318:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">remove_mapping</span><span class="f">(</span><span class="m">struct</span> <span class="b">address_space</span> <span class="f">*</span><span class="b">mapping</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="319" /><span class="True">     319:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">vm_total_pages</span><span class="f">;</span>
<a name="320" /><span class="True">     320:</span> 
<a name="321" /><span class="True">     321:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05VTUFfMA__"><span class="b">CONFIG_NUMA</span></a>
<a name="322" /><span class="True">     322:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">zone_reclaim_mode</span><span class="f">;</span>
<a name="323" /><span class="True">     323:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">sysctl_min_unmapped_ratio</span><span class="f">;</span>
<a name="324" /><span class="True">     324:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">sysctl_min_slab_ratio</span><span class="f">;</span>
<a name="325" /><span class="True">     325:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">zone_reclaim</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="f">,</span> <span class="b">gfp_t</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="326" /><span class="False">     326:</span> <span class="f">#</span><span class="n">else</span>
<a name="327" /><span class="False">     327:</span> <span class="f">#</span><span class="n">define</span> <span class="b">zone_reclaim_mode</span> <span class="c">0</span>
<a name="328" /><span class="False">     328:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">zone_reclaim</span><span class="f">(</span><span class="m">struct</span> <span class="b">zone</span> <span class="f">*</span><span class="b">z</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">mask</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">order</span><span class="f">)</span>
<a name="329" /><span class="False">     329:</span> <span class="f">{</span>
<a name="330" /><span class="False">     330:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="331" /><span class="False">     331:</span> <span class="f">}</span>
<a name="332" /><span class="True">     332:</span> <span class="f">#</span><span class="n">endif</span>
<a name="333" /><span class="True">     333:</span> 
<a name="334" /><span class="True">     334:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">page_evictable</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="335" /><span class="True">     335:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">check_move_unevictable_pages</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="f">,</span> <span class="m">int</span> <span class="b">nr_pages</span><span class="f">)</span><span class="f">;</span>
<a name="336" /><span class="True">     336:</span> 
<a name="337" /><span class="True">     337:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">scan_unevictable_pages</span><span class="f">;</span>
<a name="338" /><span class="True">     338:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">scan_unevictable_handler</span><span class="f">(</span><span class="m">struct</span> <span class="b">ctl_table</span> <span class="f">*</span><span class="f">,</span> <span class="m">int</span><span class="f">,</span>
<a name="339" /><span class="True">     339:</span>                     <span class="m">void</span> <a href="cpu.c_macros_ref.html#_X191c2VyXzA_"><span class="b">__user</span></a> <span class="f">*</span><span class="f">,</span> <span class="b">size_t</span> <span class="f">*</span><span class="f">,</span> <span class="b">loff_t</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="340" /><span class="True">     340:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05VTUFfMA__"><span class="b">CONFIG_NUMA</span></a>
<a name="341" /><span class="True">     341:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">scan_unevictable_register_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">node</span> <span class="f">*</span><span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="342" /><span class="True">     342:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">scan_unevictable_unregister_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">node</span> <span class="f">*</span><span class="b">node</span><span class="f">)</span><span class="f">;</span>
<a name="343" /><span class="False">     343:</span> <span class="f">#</span><span class="n">else</span>
<a name="344" /><span class="False">     344:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">scan_unevictable_register_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">node</span> <span class="f">*</span><span class="b">node</span><span class="f">)</span>
<a name="345" /><span class="False">     345:</span> <span class="f">{</span>
<a name="346" /><span class="False">     346:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="347" /><span class="False">     347:</span> <span class="f">}</span>
<a name="348" /><span class="False">     348:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">scan_unevictable_unregister_node</span><span class="f">(</span><span class="m">struct</span> <span class="b">node</span> <span class="f">*</span><span class="b">node</span><span class="f">)</span>
<a name="349" /><span class="False">     349:</span> <span class="f">{</span>
<a name="350" /><span class="False">     350:</span> <span class="f">}</span>
<a name="351" /><span class="True">     351:</span> <span class="f">#</span><span class="n">endif</span>
<a name="352" /><span class="True">     352:</span> 
<a name="353" /><span class="True">     353:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">kswapd_run</span><span class="f">(</span><span class="m">int</span> <span class="b">nid</span><span class="f">)</span><span class="f">;</span>
<a name="354" /><span class="True">     354:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">kswapd_stop</span><span class="f">(</span><span class="m">int</span> <span class="b">nid</span><span class="f">)</span><span class="f">;</span>
<a name="355" /><span class="False">     355:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMCG</span>
<a name="356" /><span class="False">     356:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">mem_cgroup_swappiness</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">mem</span><span class="f">)</span><span class="f">;</span>
<a name="357" /><span class="True">     357:</span> <span class="f">#</span><span class="n">else</span>
<a name="358" /><span class="True">     358:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">mem_cgroup_swappiness</span><span class="f">(</span><span class="m">struct</span> <span class="b">mem_cgroup</span> <span class="f">*</span><span class="b">mem</span><span class="f">)</span>
<a name="359" /><span class="True">     359:</span> <span class="f">{</span>
<a name="360" /><span class="True">     360:</span>     <span class="m">return</span> <span class="b">vm_swappiness</span><span class="f">;</span>
<a name="361" /><span class="True">     361:</span> <span class="f">}</span>
<a name="362" /><span class="True">     362:</span> <span class="f">#</span><span class="n">endif</span>
<a name="363" /><span class="False">     363:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMCG_SWAP</span>
<a name="364" /><span class="False">     364:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_swap</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">ent</span><span class="f">)</span><span class="f">;</span>
<a name="365" /><span class="True">     365:</span> <span class="f">#</span><span class="n">else</span>
<a name="366" /><span class="True">     366:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">mem_cgroup_uncharge_swap</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">ent</span><span class="f">)</span>
<a name="367" /><span class="True">     367:</span> <span class="f">{</span>
<a name="368" /><span class="True">     368:</span> <span class="f">}</span>
<a name="369" /><span class="True">     369:</span> <span class="f">#</span><span class="n">endif</span>
<a name="370" /><span class="True">     370:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX1NXQVBfMA__"><span class="b">CONFIG_SWAP</span></a>
<a name="371" /><span class="True">     371:</span> <span class="k">/* linux/mm/page_io.c */</span>
<a name="372" /><span class="True">     372:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">swap_readpage</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="373" /><span class="True">     373:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">swap_writepage</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">writeback_control</span> <span class="f">*</span><span class="b">wbc</span><span class="f">)</span><span class="f">;</span>
<a name="374" /><span class="True">     374:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">end_swap_bio_write</span><span class="f">(</span><span class="m">struct</span> <span class="b">bio</span> <span class="f">*</span><span class="b">bio</span><span class="f">,</span> <span class="m">int</span> <span class="b">err</span><span class="f">)</span><span class="f">;</span>
<a name="375" /><span class="True">     375:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">__swap_writepage</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">writeback_control</span> <span class="f">*</span><span class="b">wbc</span><span class="f">,</span>
<a name="376" /><span class="True">     376:</span>     <span class="m">void</span> <span class="f">(</span><span class="f">*</span><span class="b">end_write_func</span><span class="f">)</span><span class="f">(</span><span class="m">struct</span> <span class="b">bio</span> <span class="f">*</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="377" /><span class="True">     377:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">swap_set_page_dirty</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="378" /><span class="True">     378:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">end_swap_bio_read</span><span class="f">(</span><span class="m">struct</span> <span class="b">bio</span> <span class="f">*</span><span class="b">bio</span><span class="f">,</span> <span class="m">int</span> <span class="b">err</span><span class="f">)</span><span class="f">;</span>
<a name="379" /><span class="True">     379:</span> 
<a name="380" /><span class="True">     380:</span> <span class="m">int</span> <span class="b">add_swap_extent</span><span class="f">(</span><span class="m">struct</span> <span class="b">swap_info_struct</span> <span class="f">*</span><span class="b">sis</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">start_page</span><span class="f">,</span>
<a name="381" /><span class="True">     381:</span>         <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_pages</span><span class="f">,</span> <span class="b">sector_t</span> <span class="b">start_block</span><span class="f">)</span><span class="f">;</span>
<a name="382" /><span class="True">     382:</span> <span class="m">int</span> <span class="b">generic_swapfile_activate</span><span class="f">(</span><span class="m">struct</span> <span class="b">swap_info_struct</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">file</span> <span class="f">*</span><span class="f">,</span>
<a name="383" /><span class="True">     383:</span>         <span class="b">sector_t</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="384" /><span class="True">     384:</span> 
<a name="385" /><span class="True">     385:</span> <span class="k">/* linux/mm/swap_state.c */</span>
<a name="386" /><span class="True">     386:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">address_space</span> <span class="b">swapper_spaces</span><span class="f">[</span><span class="f">]</span><span class="f">;</span>
<a name="387" /><span class="True">     387:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_c3dhcF9hZGRyZXNzX3NwYWNlXzA_"><span class="b">swap_address_space</span></a><span class="f">(</span><span class="b">entry</span><span class="f">)</span> <span class="f">(</span><span class="f">&amp;</span><span class="b">swapper_spaces</span><span class="f">[</span><span class="b">swp_type</span><span class="f">(</span><span class="b">entry</span><span class="f">)</span><span class="f">]</span><span class="f">)</span>
<a name="388" /><span class="True">     388:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">total_swapcache_pages</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="389" /><span class="True">     389:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">show_swap_cache_info</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="390" /><span class="True">     390:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">add_to_swap</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">list_head</span> <span class="f">*</span><span class="b">list</span><span class="f">)</span><span class="f">;</span>
<a name="391" /><span class="True">     391:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">add_to_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">,</span> <span class="b">swp_entry_t</span><span class="f">,</span> <span class="b">gfp_t</span><span class="f">)</span><span class="f">;</span>
<a name="392" /><span class="True">     392:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">__add_to_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">swp_entry_t</span> <span class="b">entry</span><span class="f">)</span><span class="f">;</span>
<a name="393" /><span class="True">     393:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">__delete_from_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="394" /><span class="True">     394:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">delete_from_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="395" /><span class="True">     395:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_page_and_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="396" /><span class="True">     396:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">free_pages_and_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">*</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="397" /><span class="True">     397:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">lookup_swap_cache</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">)</span><span class="f">;</span>
<a name="398" /><span class="True">     398:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">read_swap_cache_async</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">,</span> <span class="b">gfp_t</span><span class="f">,</span>
<a name="399" /><span class="True">     399:</span>             <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="400" /><span class="True">     400:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">swapin_readahead</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">,</span> <span class="b">gfp_t</span><span class="f">,</span>
<a name="401" /><span class="True">     401:</span>             <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="402" /><span class="True">     402:</span> 
<a name="403" /><span class="True">     403:</span> <span class="k">/* linux/mm/swapfile.c */</span>
<a name="404" /><span class="True">     404:</span> <span class="m">extern</span> <span class="b">atomic_long_t</span> <span class="b">nr_swap_pages</span><span class="f">;</span>
<a name="405" /><span class="True">     405:</span> <span class="m">extern</span> <span class="m">long</span> <span class="b">total_swap_pages</span><span class="f">;</span>
<a name="406" /><span class="True">     406:</span> 
<a name="407" /><span class="True">     407:</span> <span class="k">/* Swap 50% full? Release swapcache more aggressively.. */</span>
<a name="408" /><span class="True">     408:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">vm_swap_full</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="409" /><span class="True">     409:</span> <span class="f">{</span>
<a name="410" /><span class="True">     410:</span>     <span class="m">return</span> <span class="b">atomic_long_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">nr_swap_pages</span><span class="f">)</span> <span class="f">*</span> <span class="c">2</span> <span class="f">&lt;</span> <span class="b">total_swap_pages</span><span class="f">;</span>
<a name="411" /><span class="True">     411:</span> <span class="f">}</span>
<a name="412" /><span class="True">     412:</span> 
<a name="413" /><span class="True">     413:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">long</span> <span class="b">get_nr_swap_pages</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="414" /><span class="True">     414:</span> <span class="f">{</span>
<a name="415" /><span class="True">     415:</span>     <span class="m">return</span> <span class="b">atomic_long_read</span><span class="f">(</span><span class="f">&amp;</span><span class="b">nr_swap_pages</span><span class="f">)</span><span class="f">;</span>
<a name="416" /><span class="True">     416:</span> <span class="f">}</span>
<a name="417" /><span class="True">     417:</span> 
<a name="418" /><span class="True">     418:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">si_swapinfo</span><span class="f">(</span><span class="m">struct</span> <span class="b">sysinfo</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="419" /><span class="True">     419:</span> <span class="m">extern</span> <span class="b">swp_entry_t</span> <span class="b">get_swap_page</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="420" /><span class="True">     420:</span> <span class="m">extern</span> <span class="b">swp_entry_t</span> <span class="b">get_swap_page_of_type</span><span class="f">(</span><span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="421" /><span class="True">     421:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">add_swap_count_continuation</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">,</span> <span class="b">gfp_t</span><span class="f">)</span><span class="f">;</span>
<a name="422" /><span class="True">     422:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">swap_shmem_alloc</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">)</span><span class="f">;</span>
<a name="423" /><span class="True">     423:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">swap_duplicate</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">)</span><span class="f">;</span>
<a name="424" /><span class="True">     424:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">swapcache_prepare</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">)</span><span class="f">;</span>
<a name="425" /><span class="True">     425:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">swap_free</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">)</span><span class="f">;</span>
<a name="426" /><span class="True">     426:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">swapcache_free</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span><span class="f">;</span>
<a name="427" /><span class="True">     427:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">free_swap_and_cache</span><span class="f">(</span><span class="b">swp_entry_t</span><span class="f">)</span><span class="f">;</span>
<a name="428" /><span class="True">     428:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">swap_type_of</span><span class="f">(</span><span class="b">dev_t</span><span class="f">,</span> <span class="b">sector_t</span><span class="f">,</span> <span class="m">struct</span> <span class="b">block_device</span> <span class="f">*</span><span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="429" /><span class="True">     429:</span> <span class="m">extern</span> <span class="m">unsigned</span> <span class="m">int</span> <span class="b">count_swap_pages</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="430" /><span class="True">     430:</span> <span class="m">extern</span> <span class="b">sector_t</span> <span class="b">map_swap_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">,</span> <span class="m">struct</span> <span class="b">block_device</span> <span class="f">*</span><span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="431" /><span class="True">     431:</span> <span class="m">extern</span> <span class="b">sector_t</span> <span class="b">swapdev_block</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_cGdvZmZfdF8w"><span class="b">pgoff_t</span></a><span class="f">)</span><span class="f">;</span>
<a name="432" /><span class="True">     432:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">page_swapcount</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="433" /><span class="True">     433:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">swap_info_struct</span> <span class="f">*</span><span class="b">page_swap_info</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="434" /><span class="True">     434:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">reuse_swap_page</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="435" /><span class="True">     435:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">try_to_free_swap</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="436" /><span class="True">     436:</span> <span class="m">struct</span> <span class="b">backing_dev_info</span><span class="f">;</span>
<a name="437" /><span class="True">     437:</span> 
<a name="438" /><span class="False">     438:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMCG</span>
<a name="439" /><span class="False">     439:</span> <span class="m">extern</span> <span class="m">void</span>
<a name="440" /><span class="False">     440:</span> <span class="b">mem_cgroup_uncharge_swapcache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">swp_entry_t</span> <span class="b">ent</span><span class="f">,</span> <span class="m">bool</span> <span class="b">swapout</span><span class="f">)</span><span class="f">;</span>
<a name="441" /><span class="True">     441:</span> <span class="f">#</span><span class="n">else</span>
<a name="442" /><span class="True">     442:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="443" /><span class="True">     443:</span> <span class="b">mem_cgroup_uncharge_swapcache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">swp_entry_t</span> <span class="b">ent</span><span class="f">,</span> <span class="m">bool</span> <span class="b">swapout</span><span class="f">)</span>
<a name="444" /><span class="True">     444:</span> <span class="f">{</span>
<a name="445" /><span class="True">     445:</span> <span class="f">}</span>
<a name="446" /><span class="True">     446:</span> <span class="f">#</span><span class="n">endif</span>
<a name="447" /><span class="True">     447:</span> 
<a name="448" /><span class="False">     448:</span> <span class="f">#</span><span class="n">else</span> <span class="k">/* CONFIG_SWAP */</span>
<a name="449" /><span class="False">     449:</span> 
<a name="450" /><span class="False">     450:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_c3dhcF9hZGRyZXNzX3NwYWNlXzA_"><span class="b">swap_address_space</span></a><span class="f">(</span><span class="b">entry</span><span class="f">)</span>        <span class="f">(</span><a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="451" /><span class="False">     451:</span> <span class="f">#</span><span class="n">define</span> <span class="b">get_nr_swap_pages</span><span class="f">(</span><span class="f">)</span>            <span class="c">0L</span>
<a name="452" /><span class="False">     452:</span> <span class="f">#</span><span class="n">define</span> <span class="b">total_swap_pages</span>            <span class="c">0L</span>
<a name="453" /><span class="False">     453:</span> <span class="f">#</span><span class="n">define</span> <span class="b">total_swapcache_pages</span><span class="f">(</span><span class="f">)</span>            <span class="c">0UL</span>
<a name="454" /><span class="False">     454:</span> <span class="f">#</span><span class="n">define</span> <span class="b">vm_swap_full</span><span class="f">(</span><span class="f">)</span>                <span class="c">0</span>
<a name="455" /><span class="False">     455:</span> 
<a name="456" /><span class="False">     456:</span> <span class="f">#</span><span class="n">define</span> <span class="b">si_swapinfo</span><span class="f">(</span><span class="b">val</span><span class="f">)</span> \
<a name="457" /><span class="False">     457:</span>     <span class="m">do</span> <span class="f">{</span> <span class="f">(</span><span class="b">val</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">freeswap</span> <span class="f">=</span> <span class="f">(</span><span class="b">val</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">totalswap</span> <span class="f">=</span> <span class="c">0</span><span class="f">;</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="458" /><span class="False">     458:</span> <span class="k">/* only sparc can not include linux/pagemap.h in this file</span>
<a name="459" /><span class="False">     459:</span> <span class="k"> * so leave page_cache_release and release_pages undeclared... */</span>
<a name="460" /><span class="False">     460:</span> <span class="f">#</span><span class="n">define</span> <span class="b">free_page_and_swap_cache</span><span class="f">(</span><span class="b">page</span><span class="f">)</span> \
<a name="461" /><span class="False">     461:</span>     <span class="b">page_cache_release</span><span class="f">(</span><span class="b">page</span><span class="f">)</span>
<a name="462" /><span class="False">     462:</span> <span class="f">#</span><span class="n">define</span> <span class="b">free_pages_and_swap_cache</span><span class="f">(</span><span class="b">pages</span><span class="f">,</span> <span class="b">nr</span><span class="f">)</span> \
<a name="463" /><span class="False">     463:</span>     <span class="b">release_pages</span><span class="f">(</span><span class="f">(</span><span class="b">pages</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">nr</span><span class="f">)</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="464" /><span class="False">     464:</span> 
<a name="465" /><span class="False">     465:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">show_swap_cache_info</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="466" /><span class="False">     466:</span> <span class="f">{</span>
<a name="467" /><span class="False">     467:</span> <span class="f">}</span>
<a name="468" /><span class="False">     468:</span> 
<a name="469" /><span class="False">     469:</span> <span class="f">#</span><span class="n">define</span> <span class="b">free_swap_and_cache</span><span class="f">(</span><span class="b">swp</span><span class="f">)</span>    <span class="b">is_migration_entry</span><span class="f">(</span><span class="b">swp</span><span class="f">)</span>
<a name="470" /><span class="False">     470:</span> <span class="f">#</span><span class="n">define</span> <span class="b">swapcache_prepare</span><span class="f">(</span><span class="b">swp</span><span class="f">)</span>        <span class="b">is_migration_entry</span><span class="f">(</span><span class="b">swp</span><span class="f">)</span>
<a name="471" /><span class="False">     471:</span> 
<a name="472" /><span class="False">     472:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">add_swap_count_continuation</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">swp</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">)</span>
<a name="473" /><span class="False">     473:</span> <span class="f">{</span>
<a name="474" /><span class="False">     474:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="475" /><span class="False">     475:</span> <span class="f">}</span>
<a name="476" /><span class="False">     476:</span> 
<a name="477" /><span class="False">     477:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">swap_shmem_alloc</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">swp</span><span class="f">)</span>
<a name="478" /><span class="False">     478:</span> <span class="f">{</span>
<a name="479" /><span class="False">     479:</span> <span class="f">}</span>
<a name="480" /><span class="False">     480:</span> 
<a name="481" /><span class="False">     481:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">swap_duplicate</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">swp</span><span class="f">)</span>
<a name="482" /><span class="False">     482:</span> <span class="f">{</span>
<a name="483" /><span class="False">     483:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="484" /><span class="False">     484:</span> <span class="f">}</span>
<a name="485" /><span class="False">     485:</span> 
<a name="486" /><span class="False">     486:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">swap_free</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">swp</span><span class="f">)</span>
<a name="487" /><span class="False">     487:</span> <span class="f">{</span>
<a name="488" /><span class="False">     488:</span> <span class="f">}</span>
<a name="489" /><span class="False">     489:</span> 
<a name="490" /><span class="False">     490:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">swapcache_free</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">swp</span><span class="f">,</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="491" /><span class="False">     491:</span> <span class="f">{</span>
<a name="492" /><span class="False">     492:</span> <span class="f">}</span>
<a name="493" /><span class="False">     493:</span> 
<a name="494" /><span class="False">     494:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">swapin_readahead</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">swp</span><span class="f">,</span> <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">,</span>
<a name="495" /><span class="False">     495:</span>             <span class="m">struct</span> <span class="b">vm_area_struct</span> <span class="f">*</span><span class="b">vma</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">addr</span><span class="f">)</span>
<a name="496" /><span class="False">     496:</span> <span class="f">{</span>
<a name="497" /><span class="False">     497:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="498" /><span class="False">     498:</span> <span class="f">}</span>
<a name="499" /><span class="False">     499:</span> 
<a name="500" /><span class="False">     500:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">swap_writepage</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">struct</span> <span class="b">writeback_control</span> <span class="f">*</span><span class="b">wbc</span><span class="f">)</span>
<a name="501" /><span class="False">     501:</span> <span class="f">{</span>
<a name="502" /><span class="False">     502:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="503" /><span class="False">     503:</span> <span class="f">}</span>
<a name="504" /><span class="False">     504:</span> 
<a name="505" /><span class="False">     505:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">lookup_swap_cache</span><span class="f">(</span><span class="b">swp_entry_t</span> <span class="b">swp</span><span class="f">)</span>
<a name="506" /><span class="False">     506:</span> <span class="f">{</span>
<a name="507" /><span class="False">     507:</span>     <span class="m">return</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">;</span>
<a name="508" /><span class="False">     508:</span> <span class="f">}</span>
<a name="509" /><span class="False">     509:</span> 
<a name="510" /><span class="False">     510:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">add_to_swap</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="m">struct</span> <span class="b">list_head</span> <span class="f">*</span><span class="b">list</span><span class="f">)</span>
<a name="511" /><span class="False">     511:</span> <span class="f">{</span>
<a name="512" /><span class="False">     512:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="513" /><span class="False">     513:</span> <span class="f">}</span>
<a name="514" /><span class="False">     514:</span> 
<a name="515" /><span class="False">     515:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">add_to_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">swp_entry_t</span> <span class="b">entry</span><span class="f">,</span>
<a name="516" /><span class="False">     516:</span>                             <span class="b">gfp_t</span> <span class="b">gfp_mask</span><span class="f">)</span>
<a name="517" /><span class="False">     517:</span> <span class="f">{</span>
<a name="518" /><span class="False">     518:</span>     <span class="m">return</span> <span class="f">-</span><span class="c">1</span><span class="f">;</span>
<a name="519" /><span class="False">     519:</span> <span class="f">}</span>
<a name="520" /><span class="False">     520:</span> 
<a name="521" /><span class="False">     521:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">__delete_from_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="522" /><span class="False">     522:</span> <span class="f">{</span>
<a name="523" /><span class="False">     523:</span> <span class="f">}</span>
<a name="524" /><span class="False">     524:</span> 
<a name="525" /><span class="False">     525:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span> <span class="b">delete_from_swap_cache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="526" /><span class="False">     526:</span> <span class="f">{</span>
<a name="527" /><span class="False">     527:</span> <span class="f">}</span>
<a name="528" /><span class="False">     528:</span> 
<a name="529" /><span class="False">     529:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">page_swapcount</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="530" /><span class="False">     530:</span> <span class="f">{</span>
<a name="531" /><span class="False">     531:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="532" /><span class="False">     532:</span> <span class="f">}</span>
<a name="533" /><span class="False">     533:</span> 
<a name="534" /><span class="False">     534:</span> <span class="f">#</span><span class="n">define</span> <span class="b">reuse_swap_page</span><span class="f">(</span><span class="b">page</span><span class="f">)</span>    <span class="f">(</span><span class="b">page_mapcount</span><span class="f">(</span><span class="b">page</span><span class="f">)</span> <span class="f">==</span> <span class="c">1</span><span class="f">)</span>
<a name="535" /><span class="False">     535:</span> 
<a name="536" /><span class="False">     536:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <span class="b">try_to_free_swap</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">)</span>
<a name="537" /><span class="False">     537:</span> <span class="f">{</span>
<a name="538" /><span class="False">     538:</span>     <span class="m">return</span> <span class="c">0</span><span class="f">;</span>
<a name="539" /><span class="False">     539:</span> <span class="f">}</span>
<a name="540" /><span class="False">     540:</span> 
<a name="541" /><span class="False">     541:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">swp_entry_t</span> <span class="b">get_swap_page</span><span class="f">(</span><span class="m">void</span><span class="f">)</span>
<a name="542" /><span class="False">     542:</span> <span class="f">{</span>
<a name="543" /><span class="False">     543:</span>     <span class="b">swp_entry_t</span> <span class="b">entry</span><span class="f">;</span>
<a name="544" /><span class="False">     544:</span>     <span class="b">entry</span><span class="f">.</span><span class="b">val</span> <span class="f">=</span> <span class="c">0</span><span class="f">;</span>
<a name="545" /><span class="False">     545:</span>     <span class="m">return</span> <span class="b">entry</span><span class="f">;</span>
<a name="546" /><span class="False">     546:</span> <span class="f">}</span>
<a name="547" /><span class="False">     547:</span> 
<a name="548" /><span class="False">     548:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">void</span>
<a name="549" /><span class="False">     549:</span> <span class="b">mem_cgroup_uncharge_swapcache</span><span class="f">(</span><span class="m">struct</span> <span class="b">page</span> <span class="f">*</span><span class="b">page</span><span class="f">,</span> <span class="b">swp_entry_t</span> <span class="b">ent</span><span class="f">)</span>
<a name="550" /><span class="False">     550:</span> <span class="f">{</span>
<a name="551" /><span class="False">     551:</span> <span class="f">}</span>
<a name="552" /><span class="False">     552:</span> 
<a name="553" /><span class="True">     553:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_SWAP */</span>
<a name="554" /><span class="True">     554:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __KERNEL__*/</span>
<a name="555" /><span class="True">     555:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* _LINUX_SWAP_H */</span>
<a name="556" /><span class="True">     556:</span> </pre>
  </body>
</html>
